<% if @announcement.new_record? %>
   <% form_tag ({:action => 'create'}, :multipart => true) do %>

   <%= render :partial => 'form' %>

   <h2>
      <span style="float: right;">
         <%= button_for "Cancel", "cancel", { :action => 'index' } %>
      </span>
      <%= button_for 'Save', 'save', "javascript:document.forms[0].submit()"%>
   </h2>

   <% end %>
<% else %>
   <% form_tag ({:action => 'update'}, :multipart => true, :method => :put) do %>

   <%= render :partial => 'form' %>

   <h2>
      <span style="float: right;">
         <%= button_for "Cancel", "cancel", { :action => 'index' } %>
      </span>
      <%= button_for 'Save', 'save', "javascript:document.forms[0].submit()"%>
   </h2>

   <% end %>
<% end %>